package com.example.jdk7;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;

public class Mytest2 {
    public static void main(String[] args) {

        Charset dd= Charset.forName("UTF-8");
        ByteBuffer bytef=dd.encode("UTF-8");
        dd.decode(bytef);

        CharBuffer cb =CharBuffer.allocate(1024) ;
        char[] chararr = cb.array();
        int dp = cb.arrayOffset()+ cb.position() ;
        int dl = cb.arrayOffset()+ cb.limit();

        ByteBuffer bytef2=ByteBuffer.allocate(1023);
        ByteBuffer bytechar=bytef2.putChar('a');
        System.out.println(bytechar);

        try {
            byte[] ssutf8= "sss".getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        System.out.println();
    }
}
